package com.sdy.supermarket.biz.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.sdy.common.model.BizException;
import com.sdy.common.model.Response;
import com.sdy.supermarket.biz.model.GsCooperationUnit;
import com.sdy.mvc.service.BaseService;
import com.sdy.supermarket.biz.vo.CoopVO;

import java.util.List;

/**
 * <p>
 * 服务类
 * </p>
 *
 * @author hyh
 * @since 2019-08-05
 */
public interface GsCooperationUnitService extends BaseService<GsCooperationUnit> {

    /**
     * 分页查询
     *
     * @param page
     * @param cooName
     * @return
     */
    IPage<GsCooperationUnit> pageList(Page<GsCooperationUnit> page, String cooName);

    /**
     * 根据ID删除数据
     *
     * @param id
     * @return
     * @throws BizException
     */
    int deleteById(Integer id) throws BizException;

    /**
     * 排序上升&下降
     *
     * @param id
     * @param type
     * @return
     * @throws BizException
     */
    int sortUpOrDown(Integer id, Integer type) throws BizException;

    /**
     * 修改&新增方法
     *
     * @param cooperationUnit
     * @return
     */
    int saveOrUpdateCoo(GsCooperationUnit cooperationUnit) throws BizException;

    /**
     * 查询有效的合作单位列表-首页展示用
     * @return
     */
    List<CoopVO> listValidCoop();
}
